package com.yjt.javatest.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yjt.javatest.entity.DTO.QuestionTestDTO;
import com.yjt.javatest.entity.Question;
import com.yjt.javatest.entity.Test;
import com.yjt.javatest.entity.DTO.UpdateQuestionTestDTO;
import com.yjt.javatest.entity.vo.CompleteQuestion;
import com.yjt.javatest.entity.vo.TestInfo;
import com.yjt.javatest.utils.APIResponse;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;


/**
 * @author fengye
 * @Date: 2022-07-16-21:24
 * @Description:
 */
public interface TestService extends IService<Test> {
    APIResponse exportStudentInfoByTestIds(List<Integer> testIds, Integer opt, HttpServletResponse response);

    APIResponse deleteTest(Integer id);
     List<CompleteQuestion> generateQuestions(List<Question> questions);

    APIResponse createTest(Test test);

    APIResponse getTests();

    APIResponse updateTest(Test test);


    APIResponse addQuestionToTest(Integer questionId, Integer testId, Integer score);

    APIResponse deleteQuestionFromTest(Integer questionId, Integer testId);


    APIResponse studentGetTestById(Long id);

    APIResponse teacherGetTestById(Long id);


    APIResponse changeQuestionOrder(UpdateQuestionTestDTO updateQuestionTestDTO);


    APIResponse setOpenStatusOn(Long id);

    APIResponse setAnswerReleaseStatus(Long id);

    APIResponse setStartTime(Long id, Date startTime);


    APIResponse setEndTime(Long id, Date endTime);

    APIResponse setAnswerReleaseTime(Long id, Date answerReleaseTime);

    APIResponse getReleasedTests(Integer teacherId);

    APIResponse addQuestionsToTest(Long testId, List<QuestionTestDTO> questionInfo);


    APIResponse teacherPreviewTest(Long id);

    APIResponse teacherPreviewQuestion(Long id);

    APIResponse finishTest(Long id);

    APIResponse createTestByTestLibId(Long testLibId, TestInfo testInfo);
}
